//-*-c++-*-
// Cassie Chin (cassiechin9793@gmail.com)

#ifndef PAIRINGFUNCTION_H
#define PAIRINGFUNCTION_H

#include <cstdint>

// Source for the encode and decode function.
// http://hbfs.wordpress.com/2011/09/27/pairing-functions/
// This pairing algorithm takes two numbers and interleaves their bits to generate a single unique number

// Used to map two values (each of a different factor and level) to a hash array
// Takes x and y and returns a unique number
// (x,y) -> P
uint64_t encode (uint32_t x, uint32_t y);

// Not used for the purposes of this program
// Takes a number (p) and generates the corresponding x and y value
// P -> (x,y)
void decode (uint64_t p, uint32_t & x, uint32_t & y);

#endif
